﻿using ArcSoftFace.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace arcsoft_usb_video.ArcFace
{
    class IntPtrCloser
    {
        private List<IntPtr> intPtrs = new List<IntPtr>();

        public IntPtr Register(IntPtr intPtr)
        {
            intPtrs.Add(intPtr);
            return intPtr;
        }

        public void Close()
        {
            foreach(var intPtr in intPtrs)
            {
                MemoryUtil.Free(intPtr);
            }
        }
    }
}
